/*
 * helpers.h
 *
 *  Created on: Oct 14, 2011
 *      Author: andrew
 */

#ifndef HELPERS_H_
#define HELPERS_H_

#include <iostream>
#include <opencv.hpp>

using namespace std;
using namespace cv;

string matToString(Mat mat);
Point2d* read2d(string);
Point3d* read3d(string);
Point2d* read2dNorm(string);
Point3d* read3dNorm(string);
Mat load2dMat(string fileName, int norm);
Mat load3dMat(string fileName, int norm);
Mat findTransform(Mat mat);
Mat leastSquares(Mat x, Mat y); //returns Mat b
Mat solveProjection(Mat, Mat);
void buildLsSolver(Mat, Mat, Mat&, Mat&);
Mat homogeneousToReal(Mat h);
double distanceBetween(Mat a, Mat b);
double residual(Mat a, Mat b);
void choosePoints(Mat p2d, Mat p3d, int k, int check, Mat& out2d, Mat& out3d, Mat&, Mat&);
Mat findBestM(Mat pts2d, Mat pts3d, Mat, Mat);
Mat findNormC(Mat m);
Mat findCenter(Mat, Mat);

#endif /* HELPERS_H_ */
